<template>
    <el-radio-group v-model="selected" size="mini" @change="onchange">
        <el-radio-button :label="1">日</el-radio-button>
        <el-radio-button :label="2">周</el-radio-button>
        <el-radio-button :label="3">月</el-radio-button>
    </el-radio-group>
</template>

<script>
export default {
    props: {
        value: {
            type: Number,
            default: 0,
        },
    },

    watch: {
        value() {
            this.selected = this.value;
        },
    },

    data() {
        return {
            selected: this.value,
        };
    },

    methods: {
        onchange(value) {
            this.$emit("input", value);
        },
    },
};
</script>

<style></style>
